package com.whosly.study.webflux.config;

import com.whosly.trino.client.TrinoClient;
import com.whosly.trino.client.TrinoConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author fengyang(yueny09 @ 163.com)
 * @date 2022年05月22日 下午4:56
 */
@Configuration
public class TrinoClientConfig {
    @Bean
    public TrinoConfig trinoConfig(){
        TrinoConfig trinoConfig = new TrinoConfig();
        trinoConfig.setServerAddress("http://localhost:8083");

        return trinoConfig;
    }

    @Bean
    public TrinoClient trinoClient(TrinoConfig config){
        TrinoClient client = new TrinoClient(config);

        return client;
    }

}
